import style from "./index.module.scss"
export type NewsData = {
    imgUrl: string
    title: string
    time: string
    content: string
}
type Props = {
    newsData: NewsData
    className?: string
}
export default function NewsCard(props: Props) {
    const { newsData: { imgUrl, title, time, content }, className = "" } = props
    return (
        <div className={`${style["news-card"]} h-180 border-2 border-[#c6d6de] p-4 relative${className}`}>
            <div className={`h-[46%] ${style["cover-img-box"]}`}>
                <img src={imgUrl} alt="" className={`h-full w-full ${style["cover-img"]}`} />
            </div>
            <h3 className='my-8 font-bold'>{title}</h3>
            <div className='flex items-center text-[#848796] font-bold'>
                <img src="/src/assets/home/time.png" alt="" className='w-5 mr-2.5' />
                {time}
            </div>
            <div className='my-8 leading-normal'>
                {content}
            </div>
            <img src="/src/assets/home/know-more.png" alt="" className='absolute bottom-4 right-4 w-18' />
        </div>
    )
}
